package poly_array;

public class Student extends Person{
    private double score;
    public Student(String name, int age,double score){
        super(name, age);
        setScore(score);
    }

    public void setScore(double score) {
        this.score = score;
    }

    public double getScore() {
        return score;
    }
    //重写父类的say方法
    public String say(){
        return "学生 姓名：" + getName() + "，年龄：" + getAge() + "岁" + " 成绩：" + score;
    }
    //特有方法
    public void study(){
        System.out.println("学生" + getName() + "学习");
    }
}
